package com.wxy.demo.thread;

import java.util.concurrent.TimeUnit;

/**
 * <p>
 * 测试子线程抛异常
 * </p>
 *
 * @author e-Xiaoyuan.Wang
 * @since 2023/2/16 21:35
 */
public class Main {
    public static void main(String[] args) {
        new Thread(() -> {
            try {
                TimeUnit.SECONDS.sleep(1);
            } catch (InterruptedException ignored) {
            }
            System.out.println("执行子线程...");
            throw new RuntimeException("子线程异常");
        }).start();
        System.out.println("主线程继续执行...");
    }
}
